Skip to content

fix: loguru import error#3956

Merged
epipav merged 1 commit intomainfrom
bugfix/loguru-import-error
Mar 25, 2026
Merged

fix: loguru import error#3956
epipav merged 1 commit intomainfrom
bugfix/loguru-import-error

Conversation

@epipav
Copy link
Copy Markdown
Collaborator

@epipav epipav commented Mar 25, 2026

Note

Low Risk
Low risk: this only removes an unused loguru import and relaxes the stderr_logger type annotation, without changing command execution behavior.

Overview
Fixes a runtime/import issue by removing the loguru dependency from services/utils.py and changing run_shell_command’s stderr_logger parameter from a loguru.Logger type to an untyped optional logger object.

Written by Cursor Bugbot for commit c089e45. This will update automatically on new commits. Configure here.

Signed-off-by: anil <epipav@gmail.com>
Copilot AI review requested due to automatic review settings March 25, 2026 12:55
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an import-time failure related to loguru usage in the git integration service utilities.

Changes:

  • Removed the direct import loguru from crowdgit.services.utils.
  • Adjusted run_shell_command()’s stderr_logger parameter to avoid referencing loguru types at runtime.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +170 to 171
stderr_logger=None,
stderr_log_level: str = "INFO",
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stderr_logger lost its type annotation to avoid importing loguru, which fixes the runtime import issue but removes typing from an otherwise well-typed API. Suggest keeping typing without a runtime dependency by using from __future__ import annotations plus a TYPE_CHECKING import, or by defining a small Protocol/type alias for the expected logger interface (e.g., an object with .log(level: str, message: str)), and update the docstring to match the actual .log(...) usage (it currently mentions .info()).

Copilot uses AI. Check for mistakes.
@epipav epipav merged commit 8ccd558 into main Mar 25, 2026
18 checks passed
@epipav epipav deleted the bugfix/loguru-import-error branch March 25, 2026 12:59
skwowet pushed a commit that referenced this pull request Mar 25, 2026
Signed-off-by: anil <epipav@gmail.com>
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants